package org.zcq100.animal;

public class AnimalTest {
	private animal a;
	public void setAnimal(String name){
		if(name=="pig"){
		this.a=new pig();
		}else if(name=="cow"){
			this.a=new cow();
		}else{
			this.a=new cat();
		}
	}
	public void liscen(){
		a.voice();
	}
	
	
	public static void main(String[] arg){
		AnimalTest animal=new AnimalTest();
		animal.setAnimal("cow");
		animal.liscen();
	}
}
